<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class Video extends Model
{


    protected $table = 'video';

    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format($this->getDateFormat());
    }


    /**
     * 获取视频所属分类
     */
    public function category()
    {
        return $this->belongsTo(VideoCategory::class, 'category_id');
    }
}
